const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "关联id",
      field: "id"
    },
    role_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "角色id",
      field: "role_id"
    },
    name: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "插件名称",
      field: "name"
    },
    plugins: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "唯一标记",
      field: "plugins"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    }
  };
  const options = {
    tableName: "sxo_role_plugins",
    comment: "",
    indexes: [{
      name: "role_id",
      unique: false,
      type: "BTREE",
      fields: ["role_id"]
    }, {
      name: "name",
      unique: false,
      type: "BTREE",
      fields: ["name"]
    }, {
      name: "plugins",
      unique: false,
      type: "BTREE",
      fields: ["plugins"]
    }]
  };
  const SxoRolePluginsModel = sequelize.define("sxo_role_plugins_model", attributes, options);
  return SxoRolePluginsModel;
};